#ifndef _EEPROM_H
#define _EEPROM_H

#include <stdint.h>


#define AT24C01		127
#define AT24C02		255
#define AT24C04		511
#define AT24C08		1023
#define AT24C16		2047
#define AT24C32		4095
#define AT24C64	    8191
#define AT24C128	16383
#define AT24C256	32767 

struct eepromOps{
    void (*eepromI2cInit)(void);
    void (*eepromI2cStart)(void);
    void (*eepromI2cStop)(void);
    uint8_t (*eepromWaitAck)(void);
    void (*eepromWriteByte)(uint8_t);
    uint8_t (*eepromReadByte)(uint8_t);
    void (*eepromDelay)(uint16_t);
    uint16_t eepromType;
};
typedef struct eepromOps eepromOps_t;

#ifdef __cplusplus
extern "C"{
#endif

extern uint8_t at24cxxReadOneByte(uint16_t readAddr);
extern uint8_t at24cxxWriteOneByte(uint16_t writeAddr,uint8_t date);
extern uint32_t at24cxxReadLenByte(uint16_t readAddr,uint8_t len);
extern void at24cxxRead(uint16_t readAddr,uint8_t *buffer,uint16_t size);
extern void at24cxxWriteLenByte(uint16_t writeAddr,uint32_t date,uint8_t len);
extern void at24cxxWrite(uint16_t writeAddr,uint8_t *buffer,uint16_t size);
extern void at24cxxInit(void);

#ifdef __cplusplus
}
#endif

#endif
